package com.cet.designpatterns.factory.abstractfactory.order;

import com.cet.designpatterns.factory.abstractfactory.pizza.LDCheesePizza;
import com.cet.designpatterns.factory.abstractfactory.pizza.LDPepperPizza;
import com.cet.designpatterns.factory.abstractfactory.pizza.Pizza;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2021-09-04 23:24
 **/
public class LDFactory implements AbstractFactory {
    @Override
    public Pizza createPizza(String orderType) {
        System.out.println("使用抽象工厂模式订购披萨！");
        Pizza pizza = null;
        if ("cheese".equals(orderType)) {
            pizza = new LDCheesePizza();
        } else if ("pepper".equals(orderType)) {
            pizza = new LDPepperPizza();
        }
        return pizza;
    }
}
